package com.taysear.parcel.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@SuppressWarnings("serial")
@Entity
public class Loadingsheet implements Serializable{

	@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer loadingsheetId;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="routeTime")
	private RouteTime routeTime;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="origin", insertable=true, updatable=false)
	private Substation origin;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="destination", insertable=true, updatable=false)
	private Substation destination;
	@Temporal(TemporalType.TIMESTAMP)
	private Date date;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="bus")
	private Bus bus;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="driver", insertable=true, updatable=false)
	private Employee driver;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="conductor", insertable=true, updatable=false)
	private Employee conductor;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="loadingsheetStatus")
	private LoadingsheetStatus loadingsheetStatus;
	
	public Integer getLoadingsheetId() {
		return loadingsheetId;
	}
	public void setLoadingsheetId(Integer loadingsheetId) {
		this.loadingsheetId = loadingsheetId;
	}
	public Substation getOrigin() {
		return origin;
	}
	public void setOrigin(Substation origin) {
		this.origin = origin;
	}
	public Substation getDestination() {
		return destination;
	}
	public void setDestination(Substation destination) {
		this.destination = destination;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Bus getBus() {
		return bus;
	}
	public void setBus(Bus bus) {
		this.bus = bus;
	}
	public Employee getDriver() {
		return driver;
	}
	public void setDriver(Employee driver) {
		this.driver = driver;
	}
	public Employee getConductor() {
		return conductor;
	}
	public void setConductor(Employee conductor) {
		this.conductor = conductor;
	}
	public LoadingsheetStatus getLoadingsheetStatus() {
		return loadingsheetStatus;
	}
	public void setLoadingsheetStatus(LoadingsheetStatus loadingsheetStatus) {
		this.loadingsheetStatus = loadingsheetStatus;
	}
	public RouteTime getRouteTime() {
		return routeTime;
	}
	public void setRouteTime(RouteTime routeTime) {
		this.routeTime = routeTime;
	}
	
}
